fix(pipeline): escape dynamic edge properties as JSON#1065
Conversation
Escape import aliases and GraphQL operation strings before serializing edge properties, preventing raw control characters and quotes from producing malformed JSON. Add a multiline GraphQL regression fixture and assert that emitted edge properties remain valid JSON. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: tmonestudio <tmonestudio@users.noreply.github.com>
a88ccc4 to
67433fc
Compare
|
Thanks for the focused JSON escaping fix. This is a high-priority 0.9.1-rc graph-correctness PR. Review will verify that dynamic edge properties are escaped identically in sequential and parallel paths and that quotes, backslashes, control characters, and non-ASCII values remain valid round-trip JSON. |
Add cbm_pipeline_set_version() to stamp a version label (e.g. '28.0', '30.0') on every node emitted during indexing. Versioned runs bypass the incremental path so both versions accumulate side-by-side in the graph. Add diff_versions MCP tool: given a project, from_version, and to_version, returns added and removed node names (default label: Class, limit 500 per side) using OPTIONAL MATCH anti-join queries. Also auto-derives version from trailing numeric path segment in index_repository (e.g. /exports/MyApp/28.0 → version='28.0') when the version param is omitted. Refs DeusData#1065 Signed-off-by: Thomas Dyar <tdyar@intersystems.com>
Add cbm_pipeline_set_version() to stamp a version label (e.g. '28.0', '30.0') on every node emitted during indexing. Versioned runs bypass the incremental path so both versions accumulate side-by-side in the graph. Add diff_versions MCP tool: given a project, from_version, and to_version, returns added and removed node names (default label: Class, limit 500 per side) using OPTIONAL MATCH anti-join queries. Also auto-derives version from trailing numeric path segment in index_repository (e.g. /exports/MyApp/28.0 → version='28.0') when the version param is omitted. Refs DeusData#1065 Signed-off-by: Thomas Dyar <tdyar@intersystems.com>
Add cbm_pipeline_set_version() to stamp a version label (e.g. '28.0', '30.0') on every node emitted during indexing. Versioned runs bypass the incremental path so both versions accumulate side-by-side in the graph. Add diff_versions MCP tool: given a project, from_version, and to_version, returns added and removed node names (default label: Class, limit 500 per side) using OPTIONAL MATCH anti-join queries. Also auto-derives version from trailing numeric path segment in index_repository (e.g. /exports/MyApp/28.0 → version='28.0') when the version param is omitted. Refs DeusData#1065 Signed-off-by: Thomas Dyar <tdyar@intersystems.com>
|
The fix is correct and I want to land it — escaping parser-derived strings through The test as written is a vacuous guard. I verified it: reverting both production changes (the To make it a genuine reproduce-first guard, the fixture needs a value that actually breaks JSON when unescaped — e.g. an import whose Could you add that? Once the test is RED-without-the-fix I'll merge immediately — the production change is already good. Thanks for closing a real JSON-corruption gap. |
What does this PR do?
Prevents malformed JSON in edge properties when extracted values contain quotes, CR/LF, or other control characters.
Two edge builders serialized parser-derived strings directly:
local_namewithout escaping;A multiline Rust import alias or GraphQL operation could therefore make
json_valid(properties)=0, and JSON-backed SQLite checks/queries could fail withmalformed JSON.Fix
Use the existing
cbm_json_escapehelper for both dynamic values before formatting the properties object.The regression fixture uses a multiline GraphQL operation and asserts that every emitted edge property remains valid JSON.
Validation
PRAGMA quick_checkandjson_validafter reindexing affected repositories.Checklist
git commit -s)make -f Makefile.cbm test(left to CI; local Windows sanitizer runtime is unavailable)